/*
 * ============================================================================
 *
 *       Filename:  acctllua.c
 *
 *    Description:  
 *
 *        Version:  1.0
 *        Created:  2015年03月10日 11时31分28秒
 *       Revision:  none
 *       Compiler:  gcc
 *
 *         Author:  jianxi sun (jianxi), ycsunjane@gmail.com
 *   Organization:  
 *
 * ============================================================================
 */
#include <stdio.h>
#include <stdint.h>
#include <stdlib.h>

#include "acctllua.h"
#include "log.h"
void acctl_getglobal(lua_State *L, const char *name)
{
#if CMAKE_LUA_MINOR < 3
	lua_getglobal(L, name);
#else
	if(!lua_getglobal(L, name)) {
		sys_err("Can not find lua function %s\n", name);
		exit(-1);
	}
#endif
}

void acctl_pcall(lua_State *L, int nargs, int nresults)
{
	if(lua_pcall(L, nargs, nresults, 0)) {
		sys_err("%s\n", lua_tostring(L, -1));
		exit(-1);
	}
}

